package com.tbit.uqbike.enums;

import lombok.Getter;

/**
 * 用量类型
 * @author <a href="mailto:liu.haoxiang@tbit.com.cn">BUGXiang</a>
 * @version 1.0
 * @since 2024-10-18
 */
@Getter
public enum UsageTypeEnum {
    YOUQU_SMS(1, "优驱API-短信"),
    YOUQU_ADVANCED_FACE(2, "优驱API-高级人脸核身-权威库"),
    YOUQU_LIVING_BODY_CERTIFICATION(3, "优驱API-活体三要素-认证"),
    YOUQU_LIVING_BODY_COMPARE(4, "优驱API-活体三要素-比对"),
    YOUQU_TWO_FACTOR(5, "优驱API-二要素实名认证"),
    YOUQU_LICENSE_RETURN_BIKE(6, "优驱API-车牌拍照还车"),
    YOUQU_PHOTO_RETURN_BIKE(7, "优驱API-拍照还车"),
    YOUQU_LIVING_FACE(8, "优驱API-活体检测+人脸对比"),
    YOUQU_ADVANCED_FACE_BUILT(9, "优驱API-高级人脸核身-自建库"),
    YOUQU_THREE_ELEMENTS_AUTH(10, "优驱API-三要素实名认证"),
    YOUQU_FACE(11, "优驱API-人脸识别"),
    YOUQU_AUTH(12, "优驱API-实人认证"),
    YOUQU_LICENSE(13, "优驱API-车牌识别"),
    SIM(14, "优驱API-sim卡"),
    YOUQU_OPERATORS(15, "运营商三要素");

    private final int value;
    private final String description;

    UsageTypeEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static UsageTypeEnum fromValue(int value) {
        for (UsageTypeEnum constant : values()) {
            if (constant.getValue() == value) {
                return constant;
            }
        }
        throw new IllegalArgumentException("Invalid value: " + value);
    }
}

